package models

import (
	"database/sql"
	"time"
)

type Time struct {
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt sql.NullTime `gorm:"index"`
}

type User struct {
	Id          int64   `json:"id"`
	Username    string  `json:"username"`
	Password    string  `json:"password"`
	Email       string  `json:"email"`
	Mobile      string  `json:"mobile"`
	UserBalance float64 `json:"user_balance"`
	UserPhoto   string  `json:"user_photo"`
	Time
}

type Goods struct {
	Id             int64   `json:"id"`
	GoodsName      string  `json:"goods_name"`
	GoodsPrice     float64 `json:"goods_price"`
	GoodsInventory int64   `json:"goods_inventory"`
	GoodsTypeId    int64   `json:"goods_type_id"`
	SoldNum        int64   `json:"sold_num"`
	IsHot          int64   `json:"is_hot"`
	Img            string  `json:"img"`
	Time
}

type Order struct {
	Id          int64   `json:"id"`
	UserId      int64   `json:"user_id"`
	MerchantId  int64   `json:"merchant_id"`
	GoodsId     int64   `json:"goods_id"`
	GoodsNum    int64   `json:"goods_num"`
	TotalAmount float64 `json:"total_amount"`
	Status      int64   `json:"status"`
	PayType     int     `json:"pay_type"`
	ShipAddress string  `json:"ship_address"`
	Time
}

type ShopCart struct {
	Id      int `json:"id"`
	UserId  int `json:"user_id"`
	GoodsId int `json:"goods_id"`
	Time
}
